﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Index.aspx.cs" Inherits="Enterprise.UI.Web.Modules.EntDisk.Index" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Enterprise.Model.EntDisk" %>
<%@ Import Namespace="Enterprise.Service.EntDisk" %>
<%@ Import Namespace="System.IO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="Content/Css/global.css" type="text/css" rel="Stylesheet" />
    <link href="Content/Css/skin_blue.css" type="text/css" rel="Stylesheet" />
    <link href="Content/Css/style.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="/Manage/Common/js/lhgdialog/lhgdialog.min.js?skin=discuz"></script>
    <script type="text/javascript">
        //第二种普通函数式调用
        function opdg(stitle, surl) {
            $.dialog({ content: 'url:' + surl, cancelBtn: false, title: stitle, width: 650, height: 340, lock: true });
        }
    </script>
<script language="javascript" type="text/javascript">
    function ShowDiv(id) {
        $("#tr_" + id).attr("style", "background-color: rgb(255, 255, 220);");
        $("#" + id).addClass("oprt txt-link");
        $("#" + id).show();
    }

    function HideDiv(id) {
        $("#tr_" + id).attr("style", "background-color: rgb(255, 255, 255);");
        $("#" + id).hide();
    }

    function DeleteOption() {
        var check = $("input:checked");
        var actor_config = "";               //定义变量
        check.each(function (i) {        //循环拼装被选中项的值
            actor_config += $(this).val() + '|';
        });
        opdg('删除选中文件', '/Modules/EntDisk/DeleteSelect.aspx?filepath=<%=FilePathName %>&file=' + actor_config);
    }

    function MoveOption() {
        var check = $("input:checked");
        var actor_config = "";               //定义变量
        check.each(function (i) {        //循环拼装被选中项的值
            actor_config += $(this).val() + '|';
        });
        opdg('移动选中文件', '/Modules/EntDisk/MoveSelect.aspx?filepath=<%=FilePathName %>&typeId=<%=typeId%>&file=' + actor_config);
        }
    </script>
    <style type="text/css">
        .current {
             background-color:red;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPH" runat="server">
    <div class="vDaohangtiaoHolder module">
                <div class="vDaohangtiao">
                    <ul>
                        <li class="first">
                            <a href="/index.aspx" title="首页">首页</a>
                        </li>
                        <li class="last">
                           <a href="Index.aspx">[公共存储]</a><a style="color:black;">&nbsp; | &nbsp;</a><a href="Index.aspx?typeId=1">[个人存储]</a>
                        </li>                         
                    </ul>
                </div>
	</div>
<div class="gNetfolder">
        <div class="g-title-1">
            <h2>
                <%=FileName %></h2>
            <span class="txt-info">共<%=folderNum %>个文件夹
                <%=fileNum %>个文件 </span>
        </div>
        <div class="path">
            <a>路径</a>： <%--<a href="Index.aspx?sid=<%=sid %>&typeId=<%=typeId %>&amp;desc=true"><%=NavString %></a> --%><span class="txt-info">
                <%=nav %></span>
        </div>
        <div class="g-toolbar">
            <div class="btngrp">
                <a class="btn btn-dft txt-b" onclick='opdg("上传文件","/Modules/EntDisk/Upload.aspx?filepath=<%=FilePathName %>")'
                    href="#"><span>上 传</span></a>                    
            </div>
            <div class="btngrp">
                <a <%--href="CreateFolder.aspx?filepath=<%=FilePathName %>"--%> onclick="opdg('新建文件夹','/Modules/EntDisk/CreateFolder.aspx?filepath=<%=FilePathName %>')"
                    class="btn btn-dft" href="#"><span>新建文件夹</span></a>
            </div>
            <div class="btngrp">
                <a onclick="DeleteOption();" class="btn btn-dft btn-dft-gl" href="#">
                    <span>删 除</span></a><%-- <a onclick="fWpPatchDel();" class="btn btn-dft btn-dft-gc" href="javascript:fGoto()">
                        <span>删 除</span></a> <a onclick="fWpSendFile();" class="btn btn-dft btn-dft-gc" href="javascript:fGoto()">
                            <span>发 送</span></a> --%><a onclick="MoveOption();" class="btn btn-dft btn-dft-gr"
                                href="#"> <span>移 动</span></a>
            </div>
            <%--<div class="btngrp">
                <a class="btn btn-dft-pd btn-dft" href="Log.aspx?sid=<%=sid %>"><span>日 志</span><b
                    class="arr"></b></a>
            </div>--%>
            <div class="btngrp btngrp-ext">
                <a onclick="return false;" class="txt-disabd" href="javscript:fGoto()">首页</a><a onclick="return false;"
                    class="txt-disabd" href="javscript:fGoto()">上页</a><a onclick="return false;" class="txt-disabd"
                        href="javscript:fGoto()">下页</a><a onclick="return false;" class="txt-disabd" href="javscript:fGoto()">末页</a>
                <select  name="page_no">
                    <option selected="" value="1">1/1</option>
                </select>
            </div>
        </div>
        <div style="" class="gNetfolder-list" id="divList">
            <table class="g-table-comm">
                <thead>
                    <tr>
                        <th class="wd0">
                        </th>
                        <th class="wd1 ckb">                            
                        </th>
                        <th class="wd2">
                            文件名
                        </th>
                        <th class="wd3">
                            大小
                        </th>
                        <th class="wd5">
                            时间<b class="ico ico-list-down"></b>
                        </th>
                    </tr>
                </thead>
                <%if (!String.IsNullOrEmpty(rootFolder))
                  { %>
                <tbody class="back">
                    <tr>
                        <td class="wd0">
                        </td>
                        <td class="wd1 ckb">
                        </td>
                        <td colspan="3">
                            <a href="Index.aspx?sid=<%=sid %>&typeId=<%=typeId %>&amp;desc=true&amp;fid=<%=BackFilePathName %>"><b
                                class="ico ico-back"></b>返回上级</a>
                        </td>
                    </tr>
                </tbody>
                <%} %>
                <tbody id="listBody">
                    <%List<FileModel> list = FileList; %>
                    <%foreach (FileModel file in list)
                      {
                          Guid gId = Guid.NewGuid();
                    %>
                    <tr id="tr_<%=gId %>" style="background-color: rgb(255, 255, 255);" onmousemove="javascript:ShowDiv('<%=gId %>');"
                        onmouseout="javascript:HideDiv('<%=gId %>');">
                        <td class="wd0">
                        </td>
                        <td class="wd1 ckb">
                            <input type="checkbox" id="chk_<%=gId %>" value="<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>" class="checkbox" />
                        </td>
                        <td class="wd2">
                            <%=Enterprise.Infrastructure.FileHelper.GetFileIco("ext"+Path.GetExtension(file.fileName) )%>
                            <%if (file.fileType == 0)
                              { %>
                            <a class="name" href="Index.aspx?sid=<%=sid %>&typeId=<%=typeId %>&amp;desc=true&amp;fid=<%=FilePathName+Path.DirectorySeparatorChar+Path.GetFileName(file.fileName) %>">
                                <%=Path.GetFileName(file.fileName)%></a> <span title="undefined" class="txt-info">(<%=FileService.GetAllNodesCount(FilePathName+Enterprise.Infrastructure.FileHelper.Encrypt(Path.DirectorySeparatorChar+Path.GetFileName(file.fileName))) %>)</span>
                            <span id="<%=gId %>" style="display: none;">[ <%--<a href="Content/Ashx/FileDownload.ashx?path=<%=FilePathName %>&url=<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>.zip&type=folder">
                                打包下载</a> | --%><a href="#" onclick="opdg('文件夹详情','/Modules/EntDisk/FolderInfo.aspx?filepath=<%=FilePathName %>&filename=<%=Enterprise.Infrastructure.FileHelper.Encrypt( Path.GetFileName(file.fileName)) %>');">
                                    改名</a> | <a href="#" onclick="opdg('删除文件夹','/Modules/EntDisk/DeleteFolder.aspx?filepath=<%=FilePathName %>&filename=<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>');">
                                        删除</a> ]</span>
                            <%}
                              else
                              { %>
                            <%=Path.GetFileName(file.fileName)%>
                            <span id="<%=gId %>" style="display: none;">[ <a href="Content/Ashx/FileDownload.ashx?path=<%=FilePathName %>&url=<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>">
                                下载</a> | <a href="#" onclick="opdg('文件详情','/Modules/EntDisk/FileInfo.aspx?filepath=<%=FilePathName %>&filename=<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>');">
                                    改名</a> | <a href="#" onclick="opdg('删除文件','/Modules/EntDisk/DeleteFile.aspx?filepath=<%=FilePathName %>&filename=<%=Enterprise.Infrastructure.FileHelper.Encrypt(Path.GetFileName(file.fileName)) %>');">
                                        删除</a> ]</span>
                            <%} %>
                        </td>
                        <%if (file.fileType == 0)
                          { %>
                        <td class="wd3">
                            <%=FileService.GetFileLength(FileService.GetFloderLength(FilePathName, Path.GetFileName(file.fileName)))%>
                        </td>
                        <td class="wd5">
                        </td>
                        <%}
                          else if (file.fileType == 1)
                          {
                              var fi = FileService.GetFileInfo(FilePathName, Path.GetFileName(file.fileName));%>
                        <td class="wd3">
                            <%=FileService.GetFileLength(fi.Length)%>
                        </td>
                        <td class="wd5">
                            <%=fi.CreationTime %>
                        </td>
                        <%} %>
                    </tr>
                    <%} %>
                </tbody>
            </table>
        </div>
        <div class="g-toolbar">
            <div class="btngrp">
                <a class="btn btn-dft txt-b" onclick='opdg("上传文件","/Modules/EntDisk/Upload.aspx?filepath=<%=FilePathName %>")'
                    href="#"><span>上 传</span></a>
            </div>
            <div class="btngrp">
                <a onclick="opdg('新建文件夹','/Modules/EntDisk/CreateFolder.aspx?filepath=<%=FilePathName %>')"
                    class="btn btn-dft" href="#"><span>新建文件夹</span></a>
            </div>
            <div class="btngrp">
                <a onclick="DeleteOption();" class="btn btn-dft btn-dft-gl" href="#">
                    <span>删 除</span></a><%-- <a onclick="fWpPatchDel();" class="btn btn-dft btn-dft-gc" href="javascript:fGoto()">
                        <span>删 除</span></a> <a onclick="fWpSendFile();" class="btn btn-dft btn-dft-gc" href="javascript:fGoto()">
                            <span>发 送</span></a> --%><a onclick="MoveOption();" class="btn btn-dft btn-dft-gr"
                                href="#"> <span>移 动</span></a>
            </div>
            <%--<div class="btngrp">
                <a class="btn btn-dft-pd btn-dft" href="Log.aspx?sid=<%=sid %>"><span>日 志</span><b
                    class="arr"></b></a>
            </div>--%>
            <div class="btngrp btngrp-ext">
                <a onclick="return false;" class="txt-disabd" href="javscript:fGoto()">首页</a><a onclick="return false;"
                    class="txt-disabd" href="javscript:fGoto()">上页</a><a onclick="return false;" class="txt-disabd"
                        href="javscript:fGoto()">下页</a><a onclick="return false;" class="txt-disabd" href="javscript:fGoto()">末页</a>
                <select name="page_no">
                    <option selected="" value="1">1/1</option>
                </select>
            </div>
        </div>
    </div>
<div id="w">
</div>
</asp:Content>
